from django.db import models
from datetime import datetime

# Create your models here.


class User(models.Model):
    username = models.CharField(max_length=20, verbose_name="用户昵称", null=False)
    password = models.CharField(max_length=16, verbose_name="密码", null=False)
    # userid = models.CharField(max_length=20, verbose_name="账号", null=False, default=" ")


class UserInfo(models.Model):
    userid = models.ForeignKey(User, on_delete=models.CASCADE)
    address = models.CharField(max_length=80, verbose_name="地址")
    email = models.EmailField(verbose_name="邮箱")


class UserApplication(models.Model):

    application_choice = ((0, "班级申请"), (1, "简历申请"))
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    application_time = models.TimeField(default=datetime.now(), verbose_name="创建时间")
    application_classes = models.IntegerField(choices=application_choice, default=0, verbose_name="申请类型")
    application_Text = models.TextField()


# class UserDetail(models.Model):
#
#     user = models.ForeignKey(User, on_delete=models.CASCADE)
#     user_class = models.CharField()
